<include file="Public/head"/>
<link href="__PUBLIC__/qwadmin/css/shen/shen.css" rel="stylesheet" type="text/css" />

<body class="no-skin">
<style>
body .demo-class .layui-layer-title{background:#6495ED; color:#fff; border: none;}
body .demo-class .layui-layer-btn{border-top:1px solid #E9E7E7}
body .demo-class .layui-layer-btn a{background:#333;}
body .demo-class .layui-layer-btn .layui-layer-btn1{background:#999;}

body th{
    color:#4F94CD;
    font-size:15px;
}
body td{
    font-size:14px;
}

#tet th{
    text-align: center;
}
#tet td{
    text-align: center;
}

#divv input{
    margin:0px 5px;
}
.dds input{
    margin:0px 5px;
}


.sp {
    border:1px solid #ccc;
    border-radius:50px;
    /*margin-top:30px;*/
}
.sp ul{
    margin-top:20px;
}
.sp ul li{
     float:left;
    margin:3px 40px;
    font-size:15px; 
    margin-left:28px;
    
}

.sp ul li button{
    width:140px;
    height:40px;
    border:1px solid #ccc;
    border-radius:50px;
}

#xxx ul{
    float:left;
    margin-top:5%;
}

#xxx ul li{
    float:left;
    padding: 5px 15px;
    margin-left:8px;
    font-size:15px;

}

</style>
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>
                <div style="width:50%;height:100px;float:left;margin-left:0%;margin-top:10px;overflow:auto;box-shadow: 5px 5px 30px #888888;"  class="sp">
                    <!-- <h5>选择查看</h5> -->
                    <ul>
                        <li onclick="g()"><button class="" style="margin-top:10px;background-color:#fff;border:2px solid #00BB00;color:#00BB00;height:40px;width:180px;font-size:17px;box-shadow: 3px 3px 10px #00BB00;"><b>办公用品</b><span class="badge" style="color:#fff;background-color:  #00BB00;float:right;margin-top:3px;"><b>{$gnum}</b></span></button></li>

                        <li><a href="{:U('Shen/fenlei',array('type'=>2))}"><button class="" style="margin-top:10px;background-color:#fff;border:2px solid #1E90FF;color:#1E90FF;height:40px;width:180px;font-size:17px;box-shadow: 3px 3px 10px #1E90FF;"><b>劳保用品</b><span class="badge" style="color:#fff;background-color:  #1E90FF;float:right;margin-top:3px;"><b>{$xnum}</b></span></button></a> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                        <a href="{:U('Shen/fenlei',array('type'=>3))}"><button class="" style="margin-top:10px;background-color:#fff;border:2px solid #FF0000;color:#FF0000;height:40px;width:180px;font-size:17px;box-shadow: 3px 3px 10px #FF0000;"><b>招待用品</b> <span class="badge" style="color:#fff;background-color:  #FF0000;float:right;margin-top:3px;"><b>{$jnum}</b></span></button></a>  </li>

                        <!-- <li><a href="{:U('Shenp/findex',array('type'=>1))}"><button class="btn-primary">业务招待费审批</button></a> &nbsp&nbsp<a href="{:U('Shenp/findex',array('type'=>2))}"><button class="btn-primary">药品耗材审批</button></a> &nbsp&nbsp<a href="{:U('Shenp/findex',array('type'=>3))}"><button class="btn-primary">行政借款审批</button></a></li>

                        <li><a href="{:U('Shenp/findex',array('type'=>4))}"><button class="btn-warning">户外费用</button></a> &nbsp&nbsp<a href="{:U('Shenp/findex',array('type'=>5))}"><button class="btn-warning">网络费用审批</button></a> &nbsp&nbsp<a href="{:U('Shenp/findex',array('type'=>6))}"><button class="btn-warning">电视费用审批</button></a> &nbsp&nbsp<button class="btn-warning">派车审批</button></li> -->
                       
                        
                    </ul>

                </div><br>

             <!--    
                <div style="margin-top:10px;float:right;">
                    <button onclick="ctong()" class="btn-success" style="height:30px;border-radius:20px;">查看所有通过</button>
                    <button onclick="cju()" class="btn-danger" style="height:30px;border-radius:20px;">查看所有拒绝</button>
                </div> -->



                <!-- <a href="{:U('Shenp/index')}"><button style="width:80px;height:25px;margin-top:150px;">返回</button></a> -->
                <!-- 行政物资审核 -->
                   <div class="row">
                        <div class="widget-box" style="margin-top:120px;height:0px;">
                            <div class="widget-header">
                                <h4 class="widget-title" style="color:#1E90FF;">
                                    <label>                 
                                        <span class="lbl"></span>
                                    </label>
                                    <b>--{$title}--</b>
                                </h4>
                                <div class="widget-toolbar">
                                    <notempty name="v.children">
                                        <a href="#" data-action="collapse">
                                            <i class="ace-icon fa fa-chevron-up"></i>
                                        </a>
                                    </notempty>
                                </div>
                            </div>
                            <notempty name="v.children">
                                <div class="widget-body">
                                    <div style="float:right;margin-top:3px;margin-right:0px;">
                                        <input id="submit" class="btn btn-info" type="button" value="一键通过">
                                        <!-- <button>ju</button> -->
                                    </div>
                                    <div class="widget-main row" style="height:100%;margin-top:2px;">
                                        <?php if(!empty($list)): ?>
                                                <!-- 行政物资审核 END -->
                                                <div>
                                                <!-- <h4 style="text-align:center;"><b>行政物资申请:</b></h4> -->
                                                <form id="form" method="post" action="{:U('Shenp/qtong')}">
                                                <table class="table table-bordered" style="margin-top:5px;">
                                                    <thead>
                                                        <tr>
                                                            <th class="center"><input class="check-all" type="checkbox" value=""></th>
                                                            <th class="center">编号</th>
                                                            <th class="center">申请类型</th>
                                                            <th class="center">物品名称</th>
                                    
                                                            <th class="center">申请数量</th>
                                                            <th class="center">剩余库存</th>

                                                            <th class="center">申请人</th>
                                                            <th class="center">所属部门</th>
                                                            <th class="center">申请时间</th>
                                                            <th class="center">操作</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                    <volist name="list" id="v">
                                                        <tr>
                                                            <td class="center">
                                                            <input class="uids" type="checkbox" name="uids[]" value="{$v['id']}">
                                                            </td>
                                                            <td class="center" id="ddi">{$v.id}</td>                                                   
                                                            <td class="center">
                                                                <?php if($v['x_type'] == 1): ?>
                                                                    <b style="color:#F4A460;font-size:17px;">办公用品</b>
                                                                <?php else: ?>
                                                                    <?php if($v['x_type'] == 2): ?>
                                                                        <b style="color:#B22222;font-size:17px;">劳保用品</b>
                                                                    <?php else: ?>
                                                                        <?php if($v['x_type'] == 3): ?>
                                                                            <b style="color:#9370DB;font-size:17px;">招待用品</b>
                                                                        <?php else: ?>
                                                                            <?php if(!empty($v['xing'])): ?>
                                                                                <b style="color:#CD0000;font-size:17px;">急性需求</b>
                                                                            <?php endif ?>
                                                                        <?php endif ?>
                                                                    <?php endif ?>
                                                                <?php endif ?>
                                                            </td>                                                   
                                                            <td class="center">{$v.wname}</td>                                                   
                                                            <td class="center">{$v.num}/{$v.com}</td>
                                                            <td class="center">
                                                                <?php if($v['type'] == 1): ?>
                                                                    急需物资申请
                                                                <?php else: ?>
                                                                    {$v.number}/{$v.com}
                                                                <?php endif ?>
                                                            </td>
                                                            <td class="center">{$v.uname}</td>
                                                            <td class="center">{$v.ment}</td>
                                                            <td class="center">{$v.time}</td>
                                                          
                                                                <td class="center" style="">
                                                                <div onclick="xtong({$v.id},this)" style="width:50px;border:1px solid #ccc;background-color:#25CB73;margin:0px auto;color:#fff;cursor:pointer;">通过</div>
                                                                <div onclick="xju({$v.id},this)" style="width:50px;border:1px solid #ccc;background-color:#B22222;margin:0px auto;color:#fff;cursor:pointer;">拒绝</div>
                                                                </td>
                                                          
                                                            
                                                        </tr>
                                                    </volist>
                                                    </tbody>
                                                </table>
                                                 </form>
                                                <!-- 行政物资审核 END -->
                                        <?php endif ?>
                                                </div>
                                        <hr>

                                       {$page}
                                    </div>
                                </div>
                            </notempty>
                        </div>
                    </div>
                <!-- 急性行政物资审核  END -->
                    <div class="form-group yyy" style="display:none;position:absolute;width:600px;height:200px;background-color:#E6E6FA;border:1px solid #ccc;box-shadow: 7px 7px 5px #888888;top:30%;left:35%;" id="centen">
                                        <form action="" id="formid">
                                                <label for="exampleInputEmail1" style="margin-top:20px;"><b style="font-size:17px;">请写下拒绝原因:</b></label>  
                                                <textarea class="form-control" rows="3" name="cent" style="width:90%;margin-left:30px;" placeholder="请输入拒绝缘由...."></textarea><br>
                                                <input type="hidden" class="ii" name="id">
                                                <input type="hidden"  name="type" value="0">
                                                <input id="tiju" class="btn btn-danger" type="button" value="提交" style="width:200px;">
                                                <input type="button" class="btn btn-info"  value="关闭" onclick="guan()">
                                        </form>
                                        </div>
                    


                


            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <!-- <include file="Public/footer"/> -->

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/layer/layer.js"></script>
<script src="__PUBLIC__/jquery-1.7.2.min.js"></script>
<script>

function ctong()
{
    layer.open({
    type: 1,
    title:  ['查看所有通过审批', 'font-size:17px;'],
    skin: 'demo-class', //加上边框
    area: ['350px', '150px'], //宽高
    content: $('#xxx'),
    // btn:'按钮'
    });
}



function t()
{
    var id = $('#ddi').text();
    console.log(id);
}




function cju()
{
    layer.open({
    type: 1,
    title:  ['查看所有拒绝审批', 'font-size:17px;'],
    skin: 'demo-class', //加上边框
    area: ['350px', '150px'], //宽高
    content: $('#jjj'),
    // btn:'按钮'
    });
}

function xtong(id,obj)
{
     // console.log(id);
         //询问框
    layer.confirm('确定通过么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
                url:"{:U('Shenp/xsh')}",
                type: 'post',
                data:{'id':id},
                dataType:'json',
                beforeSend:function(){
                    layer.load(0, {shade: false});
                },
                success:function(msg){
                    if (msg == 1111) {
                        layer.msg('已通过!ヾ(o◕∀◕)ﾉ 好棒~', {icon: 1});
                        $(obj).parent().html('[审核通过!!]').css({'color':' #7FFF00','font-width':'900'});
                        history.go(0); 
                    }else{
                        layer.msg('申请失败,请重新再试!');
                    }
                },
                complete: function() {
                     layer.closeAll('loading');
                }
            })
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });




}






function g()
{
     location.href="{:U('Shen/fenlei',array('type'=>1))}";
}

function xju(id,obj)
{


    
    $(".ii").val(id);
    $('.yyy').show();




}




function fju(id,obj)
{
     // console.log(id);
         $.ajax({
                url:"{:U('Shenp/fju')}",
                type: 'post',
                data:{'id':id},
                dataType:'json',
                beforeSend:function(){
                   layer.load(0, {shade: false});
                },
                success:function(msg){
                    // console.log(msg)
                    if (msg == 1111) {

                        layer.confirm('真的要拒绝么? ∑(っ °Д °;)っ', {
                        btn: ['确定'] //按钮
                    }, function(){
                        layer.msg('已经拒绝啦╮(╯▽╰)╭', {icon: 1});
                        $(obj).parent().html('[已被拒绝!!]').css({'color':'red','font-width':'900'});
                    }, function(){
                        layer.msg('已取消', {
                        time: 20000, //20s后自动关闭
                        // btn: ['明白了', '知道了']
                    });
                    });
                    }else{
                        layer.msg('申请失败,请重新再试!');
                    }
                 },
                 complete: function() {
                     layer.closeAll('loading');
                }
            })




}


$(".check-all").click(function () {
            $(".uids").prop("checked", this.checked);
        });
$(".uids").click(function () {
        var option = $(".ids");
        option.each(function (i) {
            if (!this.checked) {
                $(".check-all").prop("checked", false);
                return false;
            } else {
                $(".check-all").prop("checked", true);
            }
        });
    });

$("#submit").click(function () {
            
         //询问框
    layer.confirm('确定通过么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
             type: "POST",
             url:"{:U('Shenp/qtong')}",
             data:$('#form').serialize(),// 要提交的表单 
             beforeSend:function(){
                   layer.load(0, {shade: false});
                },
             success: function(msg) {
                if (msg == 1111) {
                    layer.msg('已通过!ヾ(o◕∀◕)ﾉ 好棒~', {icon: 1});
                    history.go(0); 
                }else{
                    layer.msg('申请失败,请重新再试!');
                }
             },
             complete: function() {
                     layer.closeAll('loading');
                }
         });
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });   
            
});


$("#tiju").click(function () {
         
    //询问框
    layer.confirm('确定提交么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
             type: "POST",
             url:"{:U('Shenp/bju')}",
             data:$('#formid').serialize(),// 要提交的表单 
             beforeSend:function(){
                   layer.load(0, {shade: false});
                },
             success: function(msg) {
                if (msg == 1111) {
                    layer.msg('已拒绝!ヾ(o◕∀◕)ﾉ 好棒~', {icon: 1});
                    history.go(0); 
                }else{
                    layer.msg('申请失败,请重新再试!');
                }
             },
             complete: function() {
                     layer.closeAll('loading');
                }
        });
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });
     
            
});



</script>
<div id="xxx" style="display:none;">
   <div style="margin:30px 70px;">
        <a href="{:U('Shenp/xiang',array('type'=>1))}"><button class="btn-success" style="height:35px">行政物资类</button></a>
        <a href="{:U('Shenp/xiang',array('type'=>2))}"><button class="btn-warning" style="margin-left:50px;height:37px;width:65px;">费用类</button></a>
    
   </div>
    
</div>
<div id="jjj" style="display:none;">
   <div style="margin:30px 70px;">
        <a href="{:U('Shenp/xiang',array('type'=>3))}"><button class="btn-success" style="height:35px">行政物资类</button></a>
        <a href="{:U('Shenp/xiang',array('type'=>4))}"><button class="btn-warning" style="margin-left:50px;height:37px;width:65px;">费用类</button></a>
    
   </div>
    
</div>

</body>

</html>
    